resource "huaweicloud_rds_instance" "unipus_rds" {
  name                = var.rds_name
  ## https://support.huaweicloud.com/productdesc-rds/rds_01_0034.html
  flavor              = var.rds_flavor
  #ha_replication_mode = "async"
  vpc_id              = huaweicloud_vpc.this.id
  subnet_id           = huaweicloud_vpc_subnet.this.0.id
  security_group_id   = huaweicloud_networking_secgroup.this.id
  availability_zone   = [
    data.huaweicloud_availability_zones.this.names[0],
    data.huaweicloud_availability_zones.this.names[1]
  ]
  db {
    type     = var.rds_db_type
    version  = var.rds_db_version
    password = var.rds_password
  }
  volume {
    type = "CLOUDSSD"
    
    # ULTRAHIGH: SSD storage
    # CLOUDSSD: cloud SSD storage. This storage type is supported only with general-purpose and dedicated DB instances

    size = "100"
  }
}
